import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class ThreeDButtonComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      Graphics2D g2 = (Graphics2D) g;
      // your work here
      g2.setColor(new Color(255,175,175));
      g2.draw3DRect(50,50,100,100,true);
      g2.fill3DRect(50,50,100,100,true);
   }
}